Security News
ESLint is Now Language-Agnostic: Linting JSON, Markdown, and Beyond
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
@syncfusion/ej2-compression
Advanced tools
@syncfusion/ej2-compression is a package that provides functionalities for compressing and decompressing files and data streams. It is part of the Syncfusion Essential JS 2 suite and is designed to work seamlessly with other Syncfusion components.
File Compression
This feature allows you to compress files into a ZIP archive. The code sample demonstrates how to create a ZIP archive and add a file to it, then save the archive to a specified path.
const { ZipArchive, ZipArchiveItem } = require('@syncfusion/ej2-compression');
let archive = new ZipArchive();
archive.addItem(new ZipArchiveItem('path/to/file.txt', 'file.txt'));
archive.save('path/to/archive.zip');
File Decompression
This feature allows you to decompress files from a ZIP archive. The code sample demonstrates how to load a ZIP archive and extract all its contents to a specified directory.
const { ZipArchive } = require('@syncfusion/ej2-compression');
let archive = new ZipArchive();
archive.load('path/to/archive.zip');
archive.extractAll('path/to/extract');
Stream Compression
This feature allows you to compress data streams into a ZIP archive. The code sample demonstrates how to create a ZIP archive and add a file stream to it, then save the archive to a specified path.
const { ZipArchive, ZipArchiveItem } = require('@syncfusion/ej2-compression');
const fs = require('fs');
let archive = new ZipArchive();
let readStream = fs.createReadStream('path/to/file.txt');
archive.addItem(new ZipArchiveItem(readStream, 'file.txt'));
archive.save('path/to/archive.zip');
Stream Decompression
This feature allows you to decompress data streams from a ZIP archive. The code sample demonstrates how to load a ZIP archive and extract a specific file to a write stream.
const { ZipArchive } = require('@syncfusion/ej2-compression');
const fs = require('fs');
let archive = new ZipArchive();
archive.load('path/to/archive.zip');
let writeStream = fs.createWriteStream('path/to/extract/file.txt');
archive.extractItem('file.txt', writeStream);
ADM-ZIP is a pure JavaScript implementation for ZIP file management. It provides functionalities for reading, creating, and updating ZIP files. Compared to @syncfusion/ej2-compression, ADM-ZIP is more focused on ZIP file manipulation and is widely used in the Node.js community.
Yazl is a ZIP file creation library for Node.js. It is designed to be fast and efficient, with a focus on streaming data into ZIP files. Compared to @syncfusion/ej2-compression, Yazl is more lightweight and specialized in ZIP file creation.
Yauzl is a ZIP file reading library for Node.js. It is designed to be fast and efficient, with a focus on streaming data out of ZIP files. Compared to @syncfusion/ej2-compression, Yauzl is more lightweight and specialized in ZIP file reading.
A common package of Essential JS 2 compression libraries, methods and class definitions.
Check the changelog here
FAQs
Essential JS 2 Compression library
The npm package @syncfusion/ej2-compression receives a total of 126,416 weekly downloads. As such, @syncfusion/ej2-compression popularity was classified as popular.
We found that @syncfusion/ej2-compression demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
ESLint has added JSON and Markdown linting support with new officially-supported plugins, expanding its versatility beyond JavaScript.
Security News
Members Hub is conducting large-scale campaigns to artificially boost Discord server metrics, undermining community trust and platform integrity.
Security News
NIST has failed to meet its self-imposed deadline of clearing the NVD's backlog by the end of the fiscal year. Meanwhile, CVE's awaiting analysis have increased by 33% since June.